package design.factory.second;

import design.factory.second.model.Phone;

/**
 * 客户端
 */
public class ClientMain {
    public static void main(String[] args) {
        //调用华为手机生产工厂，生产华为手机
        IPhoneFactory factory = new HuaweiPhoneFactory();
        Phone phone = factory.createPhone();
        System.out.println(phone.getModel());

        //调用小米手机生产工厂，生产小米手机
        factory = new XiaomiPhoneFactory();
        phone = factory.createPhone();
        System.out.println(phone.getModel());
    }
}
